<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户管理</title>
	<script type="text/javascript">
		$(document).ready(function() {
			layui.use('table', function(){
				let table = layui.table;
				table.init('layui-filter-table1',{
					escape : false
					,height: getLayuiTableHeight()
					,className: 'layui-table-custom'
					,done: function (res,curr,count){
					}
				});
			});
		});
	</script>
</head>

<body>
<div class="content">
	<div class="card">
		<form:form id="searchForm" class="form-inline"
				   modelAttribute="user" action="${ctxAdmin}/sys/user/list4Role">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<div class="input-group input-group-sm">
				<div class="input-group-prepend">
					<span class="input-group-text">登录账号</span>
				</div>
				<form:input path="loginName" htmlEscape="false" maxlength="100" class="form-control"/>
			</div>
			<div class="input-group input-group-sm">
				<div class="input-group-prepend">
					<span class="input-group-text">用户姓名</span>
				</div>
				<form:input path="name" htmlEscape="false" maxlength="100" class="form-control"/>
			</div>
			<div class="btn-group btn-group-sm">
				<button type="submit" class="btn btn-primary " onclick="return page();">查询</button>
				<button type="button" class="btn btn-success" onclick="resetForm();page();">重置</button>
			</div>
		</form:form>
		<table id="layui-table-id1" lay-filter="layui-filter-table1" style="display: none;">
			<thead>
			<tr>
				<th lay-data="{field:'numbers',type: 'numbers',align:'center',width:40, fixed: 'left'}">#</th>
				<th lay-data="{field:'radio',type: 'radio', fixed: 'left'}"></th>
				<th lay-data="{field:'id',hide:true}">ID</th>
				<th lay-data="{field:'o.office_name'}">科室名称</th>
				<th lay-data="{field:'a.name',width:100}">姓名</th>
				<th lay-data="{field:'a.login_name',width:100}">登录账号</th>
				<th lay-data="{field:'a.email',width:140}">邮箱</th>
				<th lay-data="{field:'a.sex',align:'center',width:40}">性别</th>
				<th lay-data="{field:'a.credential_no'}">证件编号</th>
			</tr>
			</thead>
			<tbody>
			<c:forEach items="${page.list}" var="user">
				<tr>
					<td></td>
					<td></td>
					<td>${user.id}</td>
					<td>${user.office.name}</td>
					<td>${user.name}</td>
					<td>${user.loginName}</td>
					<td>${user.email}</td>
					<td>${fns:getDictLabel(user.sex, 'sex', '')}</td>
					<td>${user.credentialNo}</td>
					<td></td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
		<sys:laypage page="${page}"/>
	</div>
</div>
</body>
</html>